package com.microsoft.tag.client.user.controller;

import com.microsoft.tag.client.user.feign.ClientUserFeign;
import com.microsoft.tag.client.user.response.UserResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * 软件著作权:王艳明
 * 系统名称:SpringBoot后台管理系统
 *
 * @author WangYanming
 * @ClassName 类:ClientUserController.java
 * @Description 功能描述:client user controller
 * @Version 1.0
 * @date 2025-10-15 上午 10:19
 */
@RestController
@RequestMapping(value = "/user")
public class ClientUserController {

    @Autowired
    private ClientUserFeign clientUserFeign;

    // 当服务端url访问不到时会直接进入fallback方法
    @RequestMapping(value = "/{id}", method = RequestMethod.GET)
    public String getUser(@PathVariable(value = "id") long id) {
        String json = clientUserFeign.getUser(id);
        return json;
    }
}
